﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SCRUM.Core.BusinessObjects.Helpers
{
    /// <summary>
    /// Class to convert lists
    /// </summary>
    /// <typeparam name="TFrom"></typeparam>
    /// <typeparam name="TTo"></typeparam>
    public class ListConverter<TTo>
    {
        public static IEnumerable<TTo> Convert(IEnumerable<Object> from)
        {
            return Convert(new List<Object>(from));
        }
        public static List<TTo> Convert(List<Object> from)
        {
            return from.ConvertAll<TTo>(new Converter<Object, TTo>(Convert));
        }

        public static TTo Convert(Object from)
        {
            return (TTo)from;
        }
    }
}
